<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

</body>
</html>

<script>
	function LeiJie(n){
		var sum =0;
		if (n%2==0) {
			for(i=2;i<=n;i++){
				if (i%2==0) {
					sum=sum+1/i
				}
			}
			return sum
		}else{
			for(i=1;i<=n;i++){
				if(i%2!=0){
					sum=sum+1/i;
				}
			}
			return sum
		}
	}

	document.write(LeiJie(3));
</script>